<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
<!--
Copyright 2008, 2009, 2010 Miguel Ángel Laguna Lobato

This file is part of Multiclinical Trial Web-PACS.

Multiclinical  Trial Web-PACS is free  software: you  can redistribute 
it and/or modify it under  the terms of the GNU General Public License 
as published by the Free  Software Foundation, either version 3 of the 
License, or (at your option) any later version.

Multiclinical  Trial Web-PACS is distributed  in the hope that it will 
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
of  MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
General Public License for more details.

You should have received a copy of the GNU General Public License
along with Multiclinical Trial Web-PACS.  If not, see 
<http://www.gnu.org/licenses/>. 
 -->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:mine="http://mctwp.urjc.es/jsf" >

<ui:composition template="/jsp/include/templateProtocolable.xhtml">

<ui:define name="saveState">
	<t:saveState value="#{tasksBean.possibleUsers}"/>
	<t:saveState value="#{tasksBean.taskListMode}" />
	<t:saveState value="#{tasksBean.tasks}" />
</ui:define>

<ui:define name="title">
	<h3>
	<h:panelGroup id="listDescription" styleClass="cuerpo">
		<h:outputText 
			value="#{msgs['jsf.headers.TasksOfImage']} #{sessionInv.image.code}" 
			rendered="#{tasksBean.imageMode}"/>
		<h:outputText 
			value="#{msgs['jsf.headers.TasksOfUser']}  #{sessionInv.user.fullName}" 
			rendered="#{tasksBean.userMode}"/>
	</h:panelGroup>
	</h3>
</ui:define>
	
<ui:define name="tableContent">
	<mine:protoTbl
		id="tareasList"
		rows="10"
		value="#{tasksBean.tasks}">
		
		<ui:define name="tableColumns">
		
			<mine:protoTblCol 
				id="code"
				value="#{row.code}"
				sortParser="number"
				header="#{msgs['jsf.generic.Code']}"/>
		
			<mine:protoTblCol 
				id="processName"
				value="#{row.processName}"
				sortParser="string"
				header="#{msgs['jsf.generic.Process']}"/>
		
			<mine:protoTblDateCol 
				id="date"
				value="#{row.date}"
				sortParser="string"
				header="#{msgs['jsf.generic.DueTo']}"/>

			<p:column id="tblImgBotonera">
				<table class="tablaBotonera">
					<tr>
						<td class="tdBotonera">		
							<h:commandLink
								id="tblImgEditTask"
								immediate="true"
								action="#{taskBean.accEditTask}">
								<h:graphicImage 
									id="tblIconImgEditTask"
									value="/jsp/icons/application_form_edit.png" 
									alt="#{msgs['jsf.actions.Edit']}"
									title="#{msgs['jsf.actions.Edit']}"/>  
								<f:setPropertyActionListener 
									value="#{row.code}" 
									target="#{taskBean.task.code}" />
							</h:commandLink>
						</td>
							
						<td class="tdBotonera">		
							<h:commandLink
								id="tblImgListImagesTask"
								immediate="true"
								action="#{viewTaskImages.accListImagesOfTask}" 
								actionListener="#{tasksBean.alUpdateTaskSelected}">
								<h:graphicImage 
									id="tblIconListImagesTask"
									value="/jsp/icons/images.png" 
									alt="#{msgs['jsf.actions.ExploreImg']}"
									title="#{msgs['jsf.actions.ExploreImg']}"/>  
							</h:commandLink>
						</td>
			
						<td class="tdBotoneraUltimo">		
							<h:commandLink
								id="tblImgListResTask"
								immediate="true"
								action="#{resultBean.accListResultsOfTask}" 
								actionListener="#{tasksBean.alUpdateTaskSelected}">
								<h:graphicImage 
									id="tblIconListResTask"
									value="/jsp/icons/table.png" 
									alt="#{msgs['jsf.actions.ExploreRes']}"
									title="#{msgs['jsf.actions.ExploreRes']}"/>  
							</h:commandLink>
						</td>
					</tr>
				</table>
			</p:column>
			
			<p:column id="tblImgSelection">
				<h:selectBooleanCheckbox value="#{row.selected}"/>
			</p:column>

		</ui:define>
	</mine:protoTbl>
</ui:define>

<ui:define name="buttonsForm">
	<h:panelGrid columns="3" styleClass="cuerpo">
		<h:selectOneMenu
			id="selectNewOrder" 
			styleClass="frmSelectOne" 
			value="#{tasksBean.newOwner}">
			<f:selectItems
				value="#{tasksBean.possibleUsers}"/>
		</h:selectOneMenu>
		<h:commandButton 
			id="btn1" 
			styleClass="frmButton" 
			value="#{msgs['jsf.actions.Reassign']}" 
			action="#{tasksBean.accReassignTasks}"/>
		<h:commandButton 
			id="btn2" 
			styleClass="frmButton" 
			value="#{msgs['jsf.actions.Done']}" 
			action="#{tasksBean.accDoneTasks}"/>
	</h:panelGrid>
</ui:define>

</ui:composition>
</html>